//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft
// premium shared source license agreement under which you licensed
// this source code. If you did not accept the terms of the license
// agreement, you are not authorized to use this source code.
// For the terms of the license, please see the license agreement
// signed by you and Microsoft.
// THE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
#pragma once

#include "XamlRuntime.h"
#include "XRPtr.h"
#include "XRCustomEvent.h"

//
// Header file used to add new Behaviors and Triggers
//
//
// Typical usage (note that in this case, Behavior was used, but Actions and Triggers 
// function in the same way):
//    <Button>
//        <Interaction.Behaviors>
//            <MyBehavior />
//        </Interaction.Behaviors>
//    </Button>
//
// This typical usage creates 3 objects: a Button, Behavior, and DependencyObject.  The
// Button is created as any FrameworkElement typcially is.  The Behavior and 
// DependencyObject are created together and function as peers.  XamlRuntime knows
// only about the DependencyObject and it is this DependencyObject that is used to store
// and access properties.  The link between the DependencyObject and the Behavior
// is provided by the IXRInteraction interface and the IXRAttachedObject interface (which 
// Behaviors,  Actions and Triggers all inherit from).
//
// In the above example, the created objects are classified as:
//    Button                       => Target Object
//    MyBehavior               => Attached Object
//    DependencyObject     => Attached DependencyObject
//
//
// NEW BEHAVIOR:
//
//  #include "XRInteractions.h"
//
//  class __declspec(uuid("...")) IMyBehavior : public IXRBehavior
//  {
//  public:
//  };
//
//  class MyBehavior: public XRBehavior<MyBehavior, IMyBehavior>
//  {
//  public:
//      virtual HRESULT OnAttached(IXRDependencyObject* pAttachedObjectDO)
//      {
//          HRESULT hr = S_OK;
//          CHR(XRBehavior::OnAttached(pAttachedObjectDO));
//          // implement behavior specific attach code
//      Error:
//          return hr;
//      }
//
//      virtual HRESULT OnDetaching(void)
//      {
//          HRESULT hr = S_OK;
//          // implement behavior specific detach code
//          CHR(XRBehavior::OnDetaching());
//      Error:
//          return hr;
//      }
//
//      static HRESULT Register()
//      {
//          return XRBehavior::Register(L"MyBehavior", L"clr-namespace:MyNamespace");
//      }
//  };
//
//
// NEW ACTION:
//
//  #include "XRInteractions.h"
//
//  class __declspec(uuid("...")) IMyAction : public IXRInteractivityTriggerAction
//  {
//  public:
//  };
//
//  class __declspec(uuid("...")) MyAction : public XRAction<MyAction, IMyAction>
//  {
//  public:
//      virtual HRESULT Invoke(XRValue *parameter)
//      {
//          // do action
//          return S_OK;
//      }
//
//      static HRESULT Register()
//      {
//          return XRAction::Register(L"MyAction", L"clr-namespace:MyNamespace");
//      }
//  };
//

class IXRInteraction;
class IXRAttachedObject;
class IXRAttachedObjectCollection;
class IXRBehaviorCollection;
class IXRInteractivityTriggerBaseCollection;
class IXRInteractivityTriggerActionCollection;

/// <summary>
/// Initialize globals, register with Alchemy
/// </summary>
/// <returns>
/// TRUE on success, FALSE on failure...
/// </returns>
EXTERN_C BOOL WINAPI InteractionsInitialize();

/// <summary>
/// Uninitialize the interactivity dll
/// </summary>
/// <returns>
/// S_OK if successful, S_FALSE if this library was never initialized
/// </returns>
EXTERN_C BOOL WINAPI InteractionsUninitialize();

/// <summary>
/// Get instance of IXRInteraction
/// </summary>
/// <returns>
/// S_OK if successful
/// </returns>
EXTERN_C HRESULT WINAPI GetInteractionsInstance(__out IXRInteraction **ppInteractions);

// Function Pointer for creating an IXRAttachedObject.
//
typedef HRESULT (CALLBACK *PFN_CREATE_ATTACHED_OBJECT)(__in IXRDependencyObject *pDependencyObject, __out IXRAttachedObject **ppAttachedObject);


/// <summary>
/// Interface defining EventTriggerAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{BFDAD556-4877-4dfb-BF30-9E4F2C14F574}")) IXRInteraction : 
    public IUnknown
{
public:
    /// <summary>
    /// Register a user defined IXRAttachedObject that will be used in  Xaml as a an object tag.
    /// </summary>
    /// <param name="iid">IID corresponding to this IXRAttachedObject</param>
    /// <param name="pName">string containing name of this IXRAttachedObject</param>
    /// <param name="pNamespace">string containing namespace of this IXRAttachedObject</param>
    /// <param name="pfCreation">function used to create an instnce of this IXRAttachedObject</param>
    /// <param name="pAttachedObjectId">ID corresponding to this IXRAttachedObject</param>
    virtual HRESULT STDMETHODCALLTYPE RegisterAttachedObject(
        __in REFIID iid,
        __in const WCHAR* pBehaviorName,
        __in const WCHAR* pNamespace,
        __in PFN_CREATE_ATTACHED_OBJECT pfCreation,
        __out UINT* pAttachedObjectId
    ) = 0;

    /// <summary>
    /// Create a user defined IXRAttachedObject.
    /// </summary>
    /// <param name="iid">GUID corresponding to the desired IXRAttachedObject</param>
    /// <param name="ppAttachedObject">IXRAttachedObject that is being created</param>
    virtual HRESULT STDMETHODCALLTYPE CreateAttachedObject(
        __in REFIID iid,
        __out IXRAttachedObject **ppAttachedObject
        ) = 0;

    // Create a user defined IXRAttachedObject.
    //  
    // This typesafe version will return the value only if the
    // destination interface (ppAttachedObject) matches the 
    // target element.
    // 
    template<typename XRObj> HRESULT CreateAttachedObject(
        __in REFIID iid, 
        __out XRObj** ppAttachedObject)
    {
        XRPtr<IXRAttachedObject> pTemp;

        HRESULT hr = CreateAttachedObject(iid, &pTemp);

        if(SUCCEEDED(hr) && pTemp)
        {
            hr = pTemp.QueryInterface(ppAttachedObject);
        }

        return hr;
    }

    /// <summary>
    /// Get the IXRAttachedObject corresponding to a given Core IXRDependencyObject
    /// </summary>
    /// <param name="pAttachedDependencyObject">Core representation of IXRAttachedObject</param>
    /// <param name="ppAttachedObject">IXRAttachedObject object</param>
    virtual HRESULT STDMETHODCALLTYPE GetAttachedObject(
        __in IXRDependencyObject *pAttachedDependencyObject,
        __out IXRAttachedObject **ppAttachedObject
        ) = 0;

    // Get the IXRAttachedObject corresponding to a given Core IXRDependencyObject.
    //  
    // This typesafe version will return the value only if the
    // destination interface (ppAttachedObject) matches the 
    // target element.
    // 
    template<typename XRObj> HRESULT GetAttachedObject(
        __in IXRDependencyObject *pAttachedDependencyObject,
        __out XRObj** ppAttachedObject)
    {
        XRPtr<IXRAttachedObject> pTemp;

        HRESULT hr = GetAttachedObject(pAttachedDependencyObject, &pTemp);

        if(SUCCEEDED(hr) && pTemp)
        {
            hr = pTemp.QueryInterface(ppAttachedObject);
        }

        return hr;
    }

    /// <summary>
    /// Get the IXRAttachedObjectCollection corresponding to a given IXRDependencyObject
    /// </summary>
    /// <param name="pPropertyName">Desired property name</param>
    /// <param name="pPropertyNamespace">Desired property namespace</param>
    /// <param name="IsAttachedProperty">Whether the desired property is attached</param>
    /// <param name="pDependencyObject">IXRDependencyObject to query for an IXRAttachedObjectCollection</param>
    /// <param name="ppAttachedObjectCollection">IXRAttachedObjectCollection object</param>
    virtual HRESULT STDMETHODCALLTYPE GetAttachedObjectCollectionProperty(
        __in const WCHAR *pPropertyName, 
        __in_opt const WCHAR *pPropertyNamespace, 
        __in BOOL IsAttachedProperty,
        __in IXRDependencyObject *pAttachedDependencyObject,
        __out IXRAttachedObjectCollection **ppAttachedObjectCollection
        ) = 0;

    /// <summary>
    /// Get the IXRBehaviorCollection corresponding to a given IXRDependencyObject
    /// </summary>
    /// <param name="pDependencyObject">IXRDependencyObject to query for an IXRAttachedObjectCollection</param>
    /// <param name="ppAttachedObjectCollection">IXRBehaviorCollection object</param>
    virtual HRESULT GetBehaviors(
        __in IXRDependencyObject *pDependencyObject,
        __out IXRBehaviorCollection** ppBehaviorCollection) = 0;

    /// <summary>
    /// Get the IXRInteractivityTriggerBaseCollection corresponding to a given IXRDependencyObject
    /// </summary>
    /// <param name="pDependencyObject">IXRDependencyObject to query for an IXRAttachedObjectCollection</param>
    /// <param name="ppTriggerCollection">IXRInteractivityTriggerBaseCollection object</param>
    virtual HRESULT GetTriggers(
        __in IXRDependencyObject *pDependencyObject,
        __out IXRInteractivityTriggerBaseCollection **ppTriggerCollection) = 0;

    /// <summary>
    /// Find the IXRAttachedObject corresponding to a name
    /// </summary>
    /// <param name="pName">desired IXRAttachedObject name</param>
    /// <param name="ppAttachedObject">desired IXRAttachedObject object</param>
    virtual HRESULT STDMETHODCALLTYPE FindAttachedObject(
        __in const WCHAR *pName,
        __out IXRAttachedObject **ppAttachedObject
        ) = 0;

    // Find the IXRAttachedObject corresponding to a name.
    //  
    // This typesafe version will return the value only if the
    // destination interface (ppAttachedObject) matches the 
    // target element.
    // 
    template<typename XRObj> HRESULT FindAttachedObject(
        __in const WCHAR *pName,
        __out XRObj** ppAttachedObject)
    {
        XRPtr<IXRAttachedObject> pTemp;

        HRESULT hr = FindAttachedObject(pName, &pTemp);

        if(SUCCEEDED(hr) && pTemp)
        {
            hr = pTemp.QueryInterface(ppAttachedObject);
        }

        return hr;
    }

    /// <summary>
    /// Cache the IXRAttachedObject to IXRDependencyObject relationship.  
    /// </summary>
    /// <param name="pAttachedObject">IXRAttachedObject object</param>
    virtual HRESULT STDMETHODCALLTYPE CacheAttachedObject(
        __in IXRAttachedObject *pAttachedObject
        ) = 0;

    /// <summary>
    /// Remove the cached IXRAttachedObject to IXRDependencyObject relationship.  This should only
    /// be called when the IXRAttachedObject is no longer needed.
    /// </summary>
    /// <param name="pAttachedObject">IXRAttachedObject object</param>
    virtual HRESULT STDMETHODCALLTYPE RemoveCachedAttachedObject(
        __in IXRAttachedObject *pAttachedObject
        ) = 0;

    /// <summary>
    /// Register an enumerable property that stores IXRInteractivityTriggerActions
    /// </summary>
    /// <param name="pPropertyName">desired Property name</param>
    /// <param name="objectId">object's ID associated with the type </param>
    /// <param name="pfnPropChange">property change notification callback</param>
    /// <param name="pPropertyId">new property's ID</param>
    virtual HRESULT STDMETHODCALLTYPE RegisterActionsDependencyProperty(
        __in const WCHAR* pPropertyName, 
        __in UINT objectId, 
        __in PFN_PROPERTY_CHANGE pfnPropChange, 
        __out DEPENDENCY_PROPERTY_ID *pPropertyId
        ) = 0;

};

DEFINE_XR_IID( IXRInteraction );
XR_SMARTPTR( IXRInteraction );



/// <summary>
/// Interface defining Behavior
/// </summary>
class __declspec(novtable) __declspec(uuid("{05FA419E-FC63-4a81-919E-68F22FB0BC19}")) IXRAttachedObject : 
    public IUnknown
{
public:
    /// <summary>
    /// Method used to attach to an existing object
    /// </summary>
    /// <param name="pTargetObject">object that is being attached to</param>
    virtual HRESULT STDMETHODCALLTYPE OnAttached(__in IXRDependencyObject* pTargetObject) = 0;

    /// <summary>
    /// Method used to detach from an existing object
    /// </summary>
    virtual HRESULT STDMETHODCALLTYPE OnDetaching() = 0;

    /// <summary>
    /// Method used to retrieve this IXRAttachedObject's core dependency object 
    /// </summary>
    /// <param name="ppAttachedDependencyObject">IXRDependencyObject used to store the IXRAttachedObject's 
    /// core dependency object</param>
    virtual HRESULT STDMETHODCALLTYPE GetAttachedDependencyObject(__out IXRDependencyObject** ppAttachedDependencyObject) = 0;

    /// <summary>
    /// Method used to retrieve the current target object
    /// </summary>
    /// <param name="ppTargetObject">IXRDependencyObject used to store the IXRAttachedObject's current target object</param>
    virtual HRESULT STDMETHODCALLTYPE GetTargetDependencyObject(__out IXRDependencyObject** ppTargetObject) = 0;

    // Get the IXRAttachedObject corresponding to a given Core IXRDependencyObject.
    //  
    // This typesafe version will return the value only if the
    // destination interface (ppAttachedObject) matches the 
    // target element.
    // 
    template<typename XRObj> HRESULT GetTargetObject(__out XRObj** ppTargetObject)
    {
        XRPtr<IXRDependencyObject> pTemp;

        HRESULT hr = GetTargetDependencyObject(&pTemp);

        if(SUCCEEDED(hr) && pTemp)
        {
            hr = pTemp.QueryInterface(ppTargetObject);
        }

        return hr;
    }
};

DEFINE_XR_IID( IXRAttachedObject );
XR_SMARTPTR( IXRAttachedObject );

/// <summary>
/// Interface defining Behavior
/// </summary>
class __declspec(novtable) __declspec(uuid("{3B277582-45FB-495b-A2CE-CE47C52120F5}")) IXRBehavior : 
    public IXRAttachedObject
{
};

DEFINE_XR_IID( IXRBehavior );
XR_SMARTPTR( IXRBehavior );

/// <summary>
/// Interface defining EventTriggerBase
/// </summary>
class __declspec(novtable) __declspec(uuid("{C37C525F-E255-44a1-98DB-B91EEE78FE42}")) IXRInteractivityTriggerBase : 
    public IXRAttachedObject
{
public:
    /// <summary>
    /// Method used to set an event name
    /// </summary>
    /// <param name="pEventName">string containing new event name</param>
    virtual HRESULT STDMETHODCALLTYPE SetEventName(__in const WCHAR* pEventName) = 0;

    /// <summary>
    /// Method used to get an event name
    /// </summary>
    /// <param name="pEventName">string used to store event name</param>
    virtual HRESULT STDMETHODCALLTYPE GetEventName(__out BSTR *pEventName) = 0;

    /// <summary>
    /// Method used to set an source name
    /// </summary>
    /// <param name="pSourceName">string containing new source name</param>
    virtual HRESULT STDMETHODCALLTYPE SetSourceName(__in const WCHAR* pSourceName) = 0;

    /// <summary>
    /// Method used to get an source name
    /// </summary>
    /// <param name="pSourceName">string used to store source name</param>
    virtual HRESULT STDMETHODCALLTYPE GetSourceName(__out BSTR *pSourceName) = 0;

    /// <summary>
    /// Method used to set the EventTriggerAction collection
    /// </summary>
    /// <param name="pActions">Collection used to store the actions</param>
    virtual HRESULT STDMETHODCALLTYPE SetActions(__in IXRInteractivityTriggerActionCollection* pActions) = 0;

    /// <summary>
    /// Method used to get the EventTriggerAction collection
    /// </summary>
    /// <param name="ppActions">Collection used to store the actions</param>
    virtual HRESULT STDMETHODCALLTYPE GetActions(__out IXRInteractivityTriggerActionCollection** ppActions) = 0;
};

DEFINE_XR_IID( IXRInteractivityTriggerBase );
XR_SMARTPTR( IXRInteractivityTriggerBase );


/// <summary>
/// Interface defining EventTriggerAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{B697D5A0-B72E-434a-B31B-8FF66EA5EE6C}")) IXRInteractivityTriggerAction : 
    public IXRAttachedObject
{
public:
    /// <summary>
    /// Method called when event triggers this action
    /// </summary>
    /// <param name="pParameter">XRValue object that contains parameter information</param>
    virtual HRESULT STDMETHODCALLTYPE Invoke(__in XRValue* pParameter) = 0;
};

DEFINE_XR_IID( IXRInteractivityTriggerAction );
XR_SMARTPTR( IXRInteractivityTriggerAction );


/// <summary>
/// Interface defining EventTriggerTargetedAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{AEA723E7-AF80-4ae7-A964-BDE00C38E314}")) IXRInteractivityTargetedTriggerAction : 
    public IXRInteractivityTriggerAction
{
public:
    // TargetName property accessors
    virtual HRESULT STDMETHODCALLTYPE SetTargetName(__in const WCHAR *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetTargetName(__out BSTR *pValue) = 0;
};

DEFINE_XR_IID( IXRInteractivityTargetedTriggerAction );
XR_SMARTPTR( IXRInteractivityTargetedTriggerAction );


/// <summary>
/// Interface defining baseclass for AttachedObject collections
/// </summary>
class __declspec(novtable) __declspec(uuid("{E3E1B4B2-5639-4cc0-B952-D90E5D4DDB98}")) IXRAttachedObjectCollection : 
    public IXRAttachedObject
{
public:
    /// <summary>
    /// Method called to add an object to this collection
    /// </summary>
    /// <param name="pItem">Object to add to this collection</param>
    /// <param name="pIndex">index item was added at</param>
    virtual HRESULT STDMETHODCALLTYPE Add(__in IXRAttachedObject *pItem, __out_opt int* pIndex) = 0;
    /// <summary>
    /// Method called to insert an object to this collection
    /// </summary>
    /// <param name="index">index to insert item at</param>
    /// <param name="pItem">Object to insert into this collection</param>
    virtual HRESULT STDMETHODCALLTYPE Insert(__in int index, __in IXRAttachedObject *pItem) = 0;
    /// <summary>
    /// Method called to remove an object from this collection
    /// </summary>
    /// <param name="index">index of object to remove</param>
    virtual HRESULT STDMETHODCALLTYPE RemoveAt(__in int index) = 0;
    /// <summary>
    /// Method called to remove an object from this collection
    /// </summary>
    /// <param name="pItem">Object to remove from this collection</param>
    virtual HRESULT STDMETHODCALLTYPE Remove(__in IXRAttachedObject *pItem) = 0;
    /// <summary>
    /// Method called to clear all objects from this collection
    /// </summary>
    virtual HRESULT STDMETHODCALLTYPE Clear() = 0;
    /// <summary>
    /// Method called to get the number of objects in this collection
    /// </summary>
    /// <param name="pCount">int storing the number of objects</param>
    virtual HRESULT STDMETHODCALLTYPE GetCount(__out int *pCount) = 0;
    /// <summary>
    /// Method called to determine if an object is contained by the collection
    /// </summary>
    /// <param name="pItem">Object to be found in this collection</param>
    /// <param name="pResult">true if the object given is found on the collection</param>
    virtual HRESULT STDMETHODCALLTYPE Contains(__in IXRAttachedObject* pItem, __out bool *pResult) = 0;
    /// <summary>
    /// Method called to find the index of an object from this collection
    /// </summary>
    /// <param name="pItem">Object from this collection</param>
    /// <param name="pIndex">index of object to find</param>
    virtual HRESULT STDMETHODCALLTYPE IndexOf(__in IXRAttachedObject* pItem,__out_opt int* pIndex) = 0;
    /// <summary>
    /// Method called to retrieve an object from this collection
    /// </summary>
    /// <param name="index">index of object to retrieve</param>
    /// <param name="ppItem">Object from this collection</param>
    virtual HRESULT STDMETHODCALLTYPE GetItem(__in int index, __out IXRAttachedObject **ppItem) = 0;

    // Get the AttachedObject corresponding to a given index.
    //  
    // This typesafe version will return the value only if the
    // destination interface (ppAttachedObject) matches the 
    // target element.
    // 
    template<typename XRObj> HRESULT GetItem(__in int index, __out XRObj** ppTargetObject)
    {
        XRPtr<IXRAttachedObject> pTemp;

        HRESULT hr = GetItem(index, &pTemp);

        if(SUCCEEDED(hr) && pTemp)
        {
            hr = pTemp.QueryInterface(ppTargetObject);
        }

        return hr;
    }
};

DEFINE_XR_IID( IXRAttachedObjectCollection );
XR_SMARTPTR( IXRAttachedObjectCollection );

/// <summary>
/// Interface defining Behavior collection
/// </summary>
class __declspec(novtable) __declspec(uuid("{7F7DBF47-8621-4a76-9B0D-9C5F85C67AE2}")) IXRBehaviorCollection : 
    public IXRAttachedObjectCollection
{
};

DEFINE_XR_IID( IXRBehaviorCollection );
XR_SMARTPTR( IXRBehaviorCollection );

/// <summary>
/// Interface defining EventTriggerBase collection
/// </summary>
class __declspec(novtable) __declspec(uuid("{C3B68425-7A4C-4b26-9E90-C451486A45B8}")) IXRInteractivityTriggerBaseCollection : 
    public IXRAttachedObjectCollection
{
};

DEFINE_XR_IID( IXRInteractivityTriggerBaseCollection );
XR_SMARTPTR( IXRInteractivityTriggerBaseCollection );

/// <summary>
/// Interface defining EventTriggerAction collection
/// </summary>
class __declspec(novtable) __declspec(uuid("{629256B3-D5CF-4e44-85F1-D041AC87CEAF}")) IXRInteractivityTriggerActionCollection : 
    public IXRAttachedObjectCollection
{
public:
    /// <summary>
    /// Method called when event triggers this action
    /// </summary>
    /// <param name="pParameter">XRValue object that contains parameter information</param>
    virtual HRESULT STDMETHODCALLTYPE Invoke(__in XRValue* pParameter) = 0;
};

DEFINE_XR_IID( IXRInteractivityTriggerActionCollection );
XR_SMARTPTR( IXRInteractivityTriggerActionCollection );

/// <summary>
/// Interface defining EventTrigger
/// </summary>
class __declspec(novtable) __declspec(uuid("{6A85EBB0-9ADA-4dbf-BAA1-BFA718C150A9}")) IXRInteractivityEventTrigger : 
    public IXRInteractivityTriggerBase
{
};

DEFINE_XR_IID( IXRInteractivityEventTrigger );
XR_SMARTPTR( IXRInteractivityEventTrigger );


/// <summary>
/// IXRFluidMoveBehavior's AppliesTo options
/// </summary>
enum XRFluidMoveScope
{
    FluidMoveScope_Self = 0,
    FluidMoveScope_Children
};

/// <summary>
/// Interface defining FluidMoveBehavior
/// </summary>
class __declspec(novtable) __declspec(uuid("{D606281B-8607-4909-ABC1-6B51BD218101}")) IXRFluidMoveBehavior : 
    public IXRBehavior
{
public:
    // Duration property accessors
    virtual HRESULT STDMETHODCALLTYPE SetDuration(__in XRDuration *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetDuration(__out XRDuration *pValue) = 0;

    // AppliesTo property accessors
    virtual HRESULT STDMETHODCALLTYPE SetAppliesTo(__in XRFluidMoveScope Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetAppliesTo(__out XRFluidMoveScope *pValue) = 0;

    // IsActive property accessors
    virtual HRESULT STDMETHODCALLTYPE SetIsActive(__in BOOL Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetIsActive(__out BOOL *pValue) = 0;

    // EaseX property accessors
    virtual HRESULT STDMETHODCALLTYPE SetEaseX(__in IXREasingFunctionBase *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetEaseX(__out IXREasingFunctionBase **ppValue) = 0;

    // EaseY property accessors
    virtual HRESULT STDMETHODCALLTYPE SetEaseY(__in IXREasingFunctionBase *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetEaseY(__out IXREasingFunctionBase **ppValue) = 0;

};

DEFINE_XR_IID( IXRFluidMoveBehavior );
XR_SMARTPTR( IXRFluidMoveBehavior );

/// <summary>
/// Interface defining MouseDragElementBehavior
/// </summary>
class __declspec(novtable) __declspec(uuid("{04ACBDCB-A2AF-4b54-94D3-F83CF46E8C59}")) IXRMouseDragElementBehavior : 
    public IXRBehavior
{
public:
    // X property accessors
    virtual HRESULT STDMETHODCALLTYPE SetX(__in float Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetX(__out float *pValue) = 0;

    // Y property accessors
    virtual HRESULT STDMETHODCALLTYPE SetY(__in float Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetY(__out float *pValue) = 0;

    // ConstrainToParentBounds property accessors
    virtual HRESULT STDMETHODCALLTYPE SetConstrainToParentBounds(__in BOOL Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetConstrainToParentBounds(__out BOOL *pValue) = 0;

    // DragBegun handlers
    virtual HRESULT STDMETHODCALLTYPE AddDragBegunEventHandler(IXRDelegate<XRMouseEventArgs, IXRMouseDragElementBehavior> *pDelegate)= 0;
    virtual HRESULT STDMETHODCALLTYPE RemoveDragBegunEventHandler(IXRDelegate<XRMouseEventArgs, IXRMouseDragElementBehavior> *pDelegate) = 0;

    // Dragging handlers
    virtual HRESULT STDMETHODCALLTYPE AddDraggingEventHandler(IXRDelegate<XRMouseEventArgs, IXRMouseDragElementBehavior> *pDelegate)= 0;
    virtual HRESULT STDMETHODCALLTYPE RemoveDraggingEventHandler(IXRDelegate<XRMouseEventArgs, IXRMouseDragElementBehavior> *pDelegate) = 0;

    // DragFinished handlers
    virtual HRESULT STDMETHODCALLTYPE AddDragFinishedEventHandler(IXRDelegate<XRMouseEventArgs, IXRMouseDragElementBehavior> *pDelegate)= 0;
    virtual HRESULT STDMETHODCALLTYPE RemoveDragFinishedEventHandler(IXRDelegate<XRMouseEventArgs, IXRMouseDragElementBehavior> *pDelegate) = 0;

};

DEFINE_XR_IID( IXRMouseDragElementBehavior );
XR_SMARTPTR( IXRMouseDragElementBehavior );


/// <summary>
/// IXRControlStoryboardAction's ControlStoryboardOption options
/// </summary>
enum XRControlStoryboardOption
{
    ControlStoryboardOption_Play = 0,
    ControlStoryboardOption_Stop,
    ControlStoryboardOption_TogglePlayPause,
    ControlStoryboardOption_Pause,
    ControlStoryboardOption_Resume,
    ControlStoryboardOption_SkipToFill
};

/// <summary>
/// Interface defining ControlStoryboardAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{85466746-D8DF-422a-9F76-F521072BF286}")) IXRControlStoryboardAction : 
    public IXRInteractivityTriggerAction
{
public:
    // ControlStoryboardOption property accessors
    virtual HRESULT STDMETHODCALLTYPE SetControlStoryboardOption(__in XRControlStoryboardOption Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetControlStoryboardOption(__out XRControlStoryboardOption *pValue) = 0;

    // Storyboard property accessors
    virtual HRESULT STDMETHODCALLTYPE SetStoryboard(__in IXRStoryboard *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetStoryboard(__out IXRStoryboard **ppValue) = 0;

};

DEFINE_XR_IID( IXRControlStoryboardAction );
XR_SMARTPTR( IXRControlStoryboardAction );

/// <summary>
/// Interface defining GoToStateAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{AF10277A-FD85-46d1-8E65-D3490E2FE3C2}")) IXRGoToStateAction : 
    public IXRInteractivityTargetedTriggerAction
{
public:
    // StateName property accessors
    virtual HRESULT STDMETHODCALLTYPE SetStateName(__in const WCHAR *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetStateName(__out BSTR *pValue) = 0;

    // UseTransitions property accessors
    virtual HRESULT STDMETHODCALLTYPE SetUseTransitions(__in BOOL Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetUseTransitions(__out BOOL *pValue) = 0;

};

DEFINE_XR_IID( IXRGoToStateAction );
XR_SMARTPTR( IXRGoToStateAction );

/// <summary>
/// Interface defining ChangePropertyAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{6924BF72-AECD-4baa-8EAC-3429E5E1DB6F}")) IXRChangePropertyAction : 
    public IXRInteractivityTargetedTriggerAction
{
public:
    // PropertyName property accessors
    virtual HRESULT STDMETHODCALLTYPE SetPropertyName(__in const WCHAR *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetPropertyName(__out BSTR *pValue) = 0;

    // Value property accessors
    virtual HRESULT STDMETHODCALLTYPE SetValue(__in XRValue *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetValue(__out XRValue *pValue) = 0;

    // Ease property accessors
    virtual HRESULT STDMETHODCALLTYPE SetEase(__in IXREasingFunctionBase *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetEase(__out IXREasingFunctionBase **ppValue) = 0;

    // Duration property accessors
    virtual HRESULT STDMETHODCALLTYPE SetDuration(__in XRDuration *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetDuration(__out XRDuration *pValue) = 0;

};

DEFINE_XR_IID( IXRChangePropertyAction );
XR_SMARTPTR( IXRChangePropertyAction );

/// <summary>
/// Interface defining RemoveElementAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{93D9694C-91A2-4e35-B0D8-F4F7F4851CBA}")) IXRRemoveElementAction : 
    public IXRInteractivityTargetedTriggerAction
{
};

DEFINE_XR_IID( IXRRemoveElementAction );
XR_SMARTPTR( IXRRemoveElementAction );

/// <summary>
/// Interface defining PlaySoundAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{1B13C834-1756-450b-840E-BDD7403066CA}")) IXRPlaySoundAction : 
    public IXRInteractivityTriggerAction
{
public:
    // Source property accessors
    virtual HRESULT STDMETHODCALLTYPE SetSource(__in const WCHAR *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetSource(__out BSTR *pValue) = 0;

    // Volume propertyaccessors
    virtual HRESULT STDMETHODCALLTYPE SetVolume(__in float Value) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetVolume(__out float *pValue) = 0;

};

DEFINE_XR_IID( IXRPlaySoundAction );
XR_SMARTPTR( IXRPlaySoundAction );

/// <summary>
/// Interface defining HyperlinkAction
/// </summary>
class __declspec(novtable) __declspec(uuid("{20EEEA20-1B10-42e4-966F-A087B43512C8}")) IXRHyperlinkAction : 
    public IXRInteractivityTriggerAction
{
public:
    // TargetWindow property accessors
    virtual HRESULT STDMETHODCALLTYPE SetTargetWindow(__in const WCHAR *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetTargetWindow(__out BSTR *pValue) = 0;

    // NavigateUri property accessors
    virtual HRESULT STDMETHODCALLTYPE SetNavigateUri(__in const WCHAR *pValue) = 0;
    virtual HRESULT STDMETHODCALLTYPE GetNavigateUri(__out BSTR *pValue) = 0;

};

DEFINE_XR_IID( IXRHyperlinkAction );
XR_SMARTPTR( IXRHyperlinkAction );

